/*
* created by Administrator on 2018/12/6
* 好的代码像粥一样,是得用时间和精力熬的。
*/
Vue.component('underway',{
    template: '#underway',
    data: function(){
        return{
         content:'',
            edit:[],
            // content2:'',
            edit2:[],
            id:0,
            id2:0,
        }
    },
    methods:{
        add:function (content) {
            if (content != '' && content != null){
                let car = { content:this.content};
                this.edit.push(car);
                console.log(123);
                this.content = null;
                this.id = parseInt(this.id+1)
            }
        },
        del:function (key) {
            let car = this.edit[key];
            this.edit2.push(car);
            this.edit.splice(key, 1);
            this.id=parseInt(this.id-1);
            this.id2=parseInt(this.id2+1);
        },
        del2:function (key) {
            let car = this.edit2[key];
            this.edit.push(car);
            this.edit2.splice(key, 1);
            this.id=parseInt(this.id+1);
            this.id2=parseInt(this.id2-1);
        },
        delete1:function (key) {
            this.edit.splice(key, 1);
            this.id=parseInt(this.id-1);
        },
        delete2:function (key) {
            this.edit2.splice(key, 1);
            this.id2=parseInt(this.id2-1);
        }
       },
});
new Vue({
    el:'#main',
    data:{},
    methods:{},
});
